var report = require("./mysql/report");
var tool = require('./tool');

exports.index = function (req, res) {
    res.render('report',{title:"发表新文章"});

}

exports.reportArticle = function(req,res){
    var title = req.query.at;
    var content = req.query.con;
    report.add(title,content,function(err,value){
        if(!err){
            res.send("1");
        }
        else{
            res.send("0");
        }
    });
}

exports.getTitle = function(req,res){
    report.getAriticleTitle(function(err,result){
        res.send(result);
    });
}

exports.getContent = function(req,res){
     res.render("articleConten.ejs",{title:"文章内容"});
 }